//
//  LPChooseReportTypeViewController.m
//  ShangHaiHuDongApp
//
//  Created by 刘应平 on 2017/7/23.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "LPChooseReportTypeViewController.h"
#import "LPOrganizationReportViewController.h"
#import "ZJReportViewController.h"
@interface LPChooseReportTypeViewController ()
/**  党员报道  */
@property (strong, nonatomic) UIButton  *partyReportButton;
/**    */
@property (strong, nonatomic) UILabel  *partyReportLabel;
/**  组织报道  */
@property (strong, nonatomic) UIButton  *organizationReportButton;
/**    */
@property (strong, nonatomic) UILabel  *organizationReportLabel;

@end

@implementation LPChooseReportTypeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.titlelabel.text = @"报到类型";
    [self.view addSubview:self.partyReportLabel];
    [self.view addSubview:self.partyReportButton];
    [self.view addSubview:self.organizationReportButton];
    [self.view addSubview:self.organizationReportLabel];
}

#pragma mark - 点击方法
- (void)clickButton:(UIButton *)sender{
    if (sender.tag == 1) {
        /**  党员报道  */
        ZJReportViewController *vc = [ZJReportViewController new];
        vc.registerModel = self.registerModel;
        [self.navigationController pushViewController:vc animated:YES];
    }else{
        /**  组织报道  */
        LPOrganizationReportViewController *vc = [LPOrganizationReportViewController new];
        vc.model = self.registerModel;
        [self.navigationController pushViewController:vc animated:YES];
    }

}

- (void)action_leftButton:(UIButton *)sender{
    [LPCostomPressentAnimationSimilarityPushAnimation backLastVc];
    if (self.isModel) {
        [self dismissViewControllerAnimated:NO completion:nil];
    }else{
        [self.navigationController popViewControllerAnimated:YES];
    }
}
#pragma mark - setter
- (UILabel *)partyReportLabel{
    if (!_partyReportLabel) {
        _partyReportLabel = ({
            NSString *string = @"注：组织关系不在市北党建云的党员到居住地党组织报到";
            CGFloat height = [CalculateLabelHeight CalculateLabelHeightWithString:string font:13 * [UIScreen zj_textFontScale] width:[UIScreen zj_screenWith] - 40 * [UIScreen zj_screenWScale]].height;
            UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, [UIScreen zj_screenWith], height)];
            label.center = self.view.center;
            label.textAlignment = NSTextAlignmentCenter;
            label.textColor = [UIColor lightGrayColor];
            label.backgroundColor = [UIColor clearColor];
            label.font = LYPFONT(13);
            label.numberOfLines = 0;
            label.text = string;
            label;
        });
    }
    return _partyReportLabel;
}


- (UIButton *)partyReportButton{
    if (!_partyReportButton) {
        _partyReportButton = ({
            UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(20 * [UIScreen zj_screenWScale], self.partyReportLabel.top - 60 * [UIScreen zj_screenHScale], [UIScreen zj_screenWith] - 40 * [UIScreen zj_screenWScale], 43 * [UIScreen zj_screenHScale])];
            [button setTitle:@"党员报到" forState:UIControlStateNormal];
            [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            button.titleLabel.font = LYPFONT(16);
            button.backgroundColor = [UIColor themeColor];
            [button addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
            button.layer.cornerRadius = 6;
            button.layer.masksToBounds = YES;
            button.tag = 1;
            button;
            
        });
    }
    return _partyReportButton;
}


- (UIButton *)organizationReportButton{
    if (!_organizationReportButton) {
        _organizationReportButton = ({
            UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(20 * [UIScreen zj_screenWScale], self.partyReportLabel.bottom + 40 * [UIScreen zj_screenHScale], [UIScreen zj_screenWith] - 40 * [UIScreen zj_screenWScale], 43 * [UIScreen zj_screenHScale])];
            [button setTitle:@"组织报到" forState:UIControlStateNormal];
            [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            button.titleLabel.font = LYPFONT(16);
            button.backgroundColor = [UIColor themeColor];
            [button addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
            button.layer.cornerRadius = 6;
            button.layer.masksToBounds = YES;
            button.tag = 2;
            button;
            
        });
    }
    return _organizationReportButton;
}


- (UILabel *)organizationReportLabel{
    if (!_organizationReportLabel) {
        _organizationReportLabel = ({
            NSString *string = @"注：组织关系不在市北党建云的党组织到所在街镇、园区党（工）委报到";
            CGFloat height = [CalculateLabelHeight CalculateLabelHeightWithString:string font:13 * [UIScreen zj_textFontScale] width:[UIScreen zj_screenWith] - 40 * [UIScreen zj_screenWScale]].height;
            UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20 * [UIScreen zj_screenWScale], self.organizationReportButton.bottom + 10 * [UIScreen zj_screenHScale], [UIScreen zj_screenWith] - 40 * [UIScreen zj_screenWScale], height)];
            label.textAlignment = NSTextAlignmentCenter;
            label.textColor = [UIColor lightGrayColor];
            label.backgroundColor = [UIColor clearColor];
            label.font = LYPFONT(13);
            label.numberOfLines = 0;
            label.text = string;
            label;
        });
    }
    return _organizationReportLabel;
}



@end
